import CryptoJS from "crypto-js";
//秘钥
const CRYPTOJSKEY = "bB7cC2aA0fS5iA0o";

// 加密
export const encrypt = (plaintText) => {
    var plaintText = plaintText;
    var options = {
        mode: CryptoJS.mode.ECB,
        padding: CryptoJS.pad.Pkcs7
    };
    var key = CryptoJS.enc.Utf8.parse(CRYPTOJSKEY);
    var encryptedData = CryptoJS.AES.encrypt(plaintText, key, options);
    var encryptedBase64Str = encryptedData.toString()
    return encryptedBase64Str;
};